/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.util.LinkedList;

/**
 *
 * @author Stupi
 */
public class Helper {
    
    public static int [] clustersToArrayXvalues (LinkedList<Point> [] clusters, int size) {
        
        int [] clusterArrayX = new int [size];
        int count = 0;
        
        for (int i = 0; i < clusters.length; i++) {

            for (int j = 0; j < clusters[i].size(); j++) {
                
                Point p = clusters[i].get(j);
                clusterArrayX[count++] = p.getX();
            }       
        }
        return clusterArrayX;
    }
    
    public static int [] clustersToArrayYvalues (LinkedList<Point> [] clusters, int size) {
        
        int [] clusterArrayY = new int [size];
        int count = 0;
        
        for (int i = 0; i < clusters.length; i++) {

            for (int j = 0; j < clusters[i].size(); j++) {
                
                Point p = clusters[i].get(j);
                clusterArrayY[count++] = p.getY();
            }
        }
        return clusterArrayY;
    }
    
    public static int [] createArrayLimit (LinkedList<Point> [] clusters) {
        int count = 0;
        
        int [] limits = new int [clusters.length];
        for (int i = 0; i < limits.length; i++) {
            count = count + clusters[i].size();
            limits[i] = count;
           
        }
        
        
        return limits;
    }
}
